16. Quiz: More With Dictionaries
Context
Use the dictionary below to answer ALL of the questions regarding dictionaries. Consider you have a dictionary named animals
that looks like this:
animals = {'dogs': [20, 10, 15, 8, 32, 15], 'cats': [3,4,2,8,2,4], 'rabbits': [2, 3, 3], 'fish': [0.3, 0.5, 0.8, 0.3, 1]}
Let's try a few ideas with this dictionary! If you want to try any of the code yourself, you can test it in the environment at the bottom of the page.
QUIZ QUESTION::
Question 1
Match each description to the value it describes.
ANSWER CHOICES:
Description |
Value |
---|---|
string |
|
15 |
|
[0.3, 0.5, 0.8, 0.3, 1] |
|
None |
|
[20, 10, 15, 8, 32, 15] |
|
list |
|
Error |
|
Error |
|
8 |
|
Error |
SOLUTION:
Description |
Value |
---|---|
string |
|
[0.3, 0.5, 0.8, 0.3, 1] |
|
[20, 10, 15, 8, 32, 15] |
|
list |
|
Error |
|
Error |
|
8 |
|
Error |
Start Quiz:
animals = {'dogs': [20, 10, 15, 8, 32, 15],
'cats': [3,4,2,8,2,4],
'rabbits': [2, 3, 3],
'fish': [0.3, 0.5, 0.8, 0.3, 1]}